package com.ssy.lingxi.member.merchant.controller.mobile;

import com.ssy.lingxi.common.model.vo.PageVO;
import com.ssy.lingxi.common.response.PageData;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.member.merchant.model.vo.basic.response.MemberRightScoreVO;
import com.ssy.lingxi.member.merchant.model.vo.manage.request.MemberAndRoleIdVO;
import com.ssy.lingxi.member.merchant.model.vo.mobile.request.MobileRightScoreHistoryPageVO;
import com.ssy.lingxi.member.merchant.model.vo.mobile.request.MobileShopRightScorePageVO;
import com.ssy.lingxi.member.merchant.model.vo.mobile.response.MobileRightScoreHistoryVO;
import com.ssy.lingxi.member.merchant.model.vo.mobile.response.MobileRightScoreVO;
import com.ssy.lingxi.member.merchant.model.vo.mobile.response.MobileShopRightScoreHistoryVO;
import com.ssy.lingxi.member.merchant.service.mobile.IMobileLrcService;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * @menu App - 会员等级、权益、信用相关接口
 * @author 万宁
 * @version 2.0.0
 * @date 2020-12-17
 */
@RestController
@RequestMapping("/member/mobile/lrc")
public class MobileLrcController {

    @Resource
    private IMobileLrcService mobileLrcService;

    /**
     * “我的积分” - 分页查询列表
     * @param headers Http头部信息
     * @param pageVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/right/page", method = RequestMethod.GET)
    public Wrapper<PageData<MobileRightScoreVO>> pageRightScore(@RequestHeader HttpHeaders headers, @Valid PageVO pageVO) {
        return mobileLrcService.pageRightScore(headers, pageVO);
    }

    /**
     * “我的积分” - 分页查询权益积分历史记录
     * @param headers Http头部信息
     * @param pageVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/right/detail/page", method = RequestMethod.GET)
    public Wrapper<PageData<MobileRightScoreHistoryVO>> pageRightScoreHistory(@RequestHeader HttpHeaders headers, @Valid MobileRightScoreHistoryPageVO pageVO) {
        return mobileLrcService.pageRightScoreHistory(headers, pageVO);
    }

    /**
     * “找店铺 - 积分兑换” - 分页查询权益积分历史记录
     * @param headers Http头部信息
     * @param pageVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/right/shop/detail/page", method = RequestMethod.GET)
    public Wrapper<MobileShopRightScoreHistoryVO> pageShopRightScoreHistory(@RequestHeader HttpHeaders headers, @Valid MobileShopRightScorePageVO pageVO) {
        return mobileLrcService.pageShopRightScoreHistory(headers, pageVO);
    }

    /**
     * “积分订单” - 查询平台通用和会员专有权益积分
     * @param headers Http头部信息
     * @param idVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/right/point/get", method = RequestMethod.GET)
    public Wrapper<MemberRightScoreVO> getMemberRightScore(@RequestHeader HttpHeaders headers, @Valid MemberAndRoleIdVO idVO) {
        return mobileLrcService.getMemberRightScore(headers, idVO);
    }
}
